package com.mapper;

import com.pojo.user;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface usermapper {
//查询登录的账号密码是否存在
    @Select("select * from user where name = #{name} and mm = #{mm}")
    user select(@Param("name") String name, @Param("mm") String password);

//    注册操作，先判断用户名是否被占用
    @Select("select * from user where name = #{name}")
    user select2(String name);

//  注册操作2，添加用户名和密码到数据库
    @Insert("insert into user values (#{name},#{mm})")
    void add2(user u);
}
